import Mock from 'mockjs'

const Random = Mock.Random

// 业务单
const bizList = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            startdate: Random.date(), // Random.date()指示生成的日期字符串的格式,默认为yyyy-MM-dd
            content: Random.csentence(3, 10), //  Random.csentence( min, max )
            cust: Random.csentence(3, 10),
            digest: Random.csentence(3, 10),
            sum: '30000',
            received: '444',
            debt: '4444',
            design: Random.cname(), // Random.cname() 随机生成一个常见的中文姓名
            tellaS: Random.cname(),
            enddate: Random.date(),
            state: '未审核'
            // time: Random.time() // Random.time() 返回一个随机的时间字符串
        }
        list.push(item)
    }

    return list
}

const bizAudit = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            startdate: Random.date(),
            cust: Random.csentence(3, 10),
            digest: Random.csentence(3, 10),
            sum: '30000',
            tellaS: Random.cname(),
            enddate: Random.date()
        }
        list.push(item)
    }

    return list
}

const bizFinish = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            startdate: Random.date(),
            cust: Random.csentence(3, 10),
            digest: Random.csentence(3, 10),
            tellaS: Random.cname(),
            enddate: Random.date(),
            workplace: Random.csentence(3, 5)
        }
        list.push(item)
    }

    return list
}

const dlvy = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            startdate: Random.date(),
            cust: Random.csentence(3, 10),
            phone: '15699856584',
            digest: Random.csentence(3, 10),
            enddate: Random.date(),
            due: 1111,
            dlvyState: '部分未送货'
        }
        list.push(item)
    }

    return list
}

const bizMoney = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            bank: Random.csentence(2, 5),
            moneydate: '收款日期',
            cust: Random.csentence(3, 10),
            sum: '33333',
            digest: Random.csentence(3, 10),
            agent: Random.cname(),
            biller: Random.cname(),
            moneyState: '已审核'
        }
        list.push(item)
    }

    return list
}

// 采购单
const stockAudit = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            stockInDate: Random.date(),
            supplier: Random.cname(),
            sum: '30000',
            prepay: '444',
            agent: Random.cname(),
            stockName: Random.csentence(3, 7)
        }
        list.push(item)
    }

    return list
}

const stockFind = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            materialNumber: i,
            standard: Random.csentence(3, 10),
            unit: '米',
            stockNum: 3333,
            stockName: Random.csentence(3, 6),
            stockInNum: 4444,
            stockOutNum: 222,
            surplusNum: 555
        }
        list.push(item)
    }

    return list
}

const stockIn = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            stockInDate: Random.date(),
            supplier: Random.csentence(3, 5),
            digest: Random.csentence(3, 10),
            sum: 3333,
            prepay: 444,
            due: 22,
            agent: Random.cname(),
            biller: Random.cname(),
            stockName: Random.csentence(3, 6),
            stockInState: '审核中'
        }
        list.push(item)
    }

    return list
}

// 财务

const income = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            startdate: Random.date(),
            content: Random.csentence(3, 10),
            cust: Random.csentence(3, 10),
            digest: Random.csentence(3, 10),
            sum: '30000',
            received: '444',
            debt: '4444',
            design: Random.cname(),
            tellaS: Random.cname(),
            enddate: Random.date(),
            state: '未审核'
        }
        list.push(item)
    }

    return list
}

const payout = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            startdate: Random.date(),
            cust: Random.csentence(3, 10),
            digest: Random.csentence(3, 10),
            sum: '30000',
            tellaS: Random.cname(),
            enddate: Random.date()
        }
        list.push(item)
    }

    return list
}

// toolbar
const cust = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            custCompany: Random.csentence(3, 10),
            cust: Random.cname(),
            phone: '1558765485',
            address: Random.csentence(3, 10),
            agent: Random.cname(),
            digest: Random.csentence(3, 10),
            biz: '相关业务单',
            report: '报表'
        }
        list.push(item)
    }

    return list
}

const supplier = function() {
    let list = []
    for (let i = 0; i < 20; i++) {
        let item = {
            num: i,
            supplierCompany: Random.csentence(3, 7),
            supplier: Random.cname(),
            phone: '4345345354354',
            address: Random.csentence(3, 7),
            agent: Random.cname(),
            digest: Random.csentence(3, 7),
            stock: '相关采购单',
            report: '报表'
        }
        list.push(item)
    }

    return list
}

const profit = function() {
    let list = []
    for (let i = 1; i < 13; i++) {
        let item = {
            month: i,
            bizIncome: 453453,
            otherIncome: 454,
            stockPayout: 5454,
            otherPayout: 5532,
            reconciliations: 554,
            profit: 543453.54
        }
        list.push(item)
    }

    return list
}
export default [
    {
        url: /\/home\/str\/\w+/, // '/home/test/:id'
        method: 'get',
        data: '这是从 mockjs 中获取的字符串'
    },
    {
        url: '/getBizOrder',
        method: 'get',
        data: bizList
    },
    {
        url: '/getBizAudit',
        method: 'get',
        data: bizAudit
    },
    {
        url: '/getBizFinish',
        method: 'get',
        data: bizFinish
    },
    {
        url: '/getDlvy',
        method: 'get',
        data: dlvy
    },
    {
        url: '/getBizMoney',
        method: 'get',
        data: bizMoney
    },
    {
        url: '/getStockAudit',
        method: 'get',
        data: stockAudit
    },
    {
        url: '/getStockFind',
        method: 'get',
        data: stockFind
    },
    {
        url: '/getStockIn',
        method: 'get',
        data: stockIn
    },
    {
        url: '/getIncome',
        method: 'get',
        data: income
    },
    {
        url: '/getPayout',
        method: 'get',
        data: payout
    },
    {
        url: '/getCust',
        method: 'get',
        data: cust
    },
    {
        url: '/getSupplier',
        method: 'get',
        data: supplier
    },
    {
        url: '/getProfit',
        method: 'get',
        data: profit
    }
]
